package com.jianyun.jyzs.presenter;

import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
import com.jianyun.jyzs.model.UpdataEmailModel;
import com.jianyun.jyzs.model.imdoel.IUpdateEmailModel;
import com.jianyun.jyzs.view.iview.IUpdateEmailView;

/**
 * Created by yangshijun on 2018/8/1.
 */

public class UpdataEmailPresenter extends MvpBasePresenter<IUpdateEmailView> {
    public void updataEmaile(String enterpriseCode, String userId, String email){
        if (!isViewAttached()) {
            return;
        }
        UpdataEmailModel.getInstance().updataEmail(enterpriseCode, userId, email, new IUpdateEmailModel.OnUpdateEmailListener() {
            @Override
            public void onSuccess() {
                getView().onSuccess();
                getView().hideLoding();
            }

            @Override
            public void onFailed() {
                getView().onFailed();
                getView().hideLoding();
            }

            @Override
            public void onException(String msg) {
                getView().onException(msg);
                getView().hideLoding();
            }
        });
    }
}
